using System;
using System.Collections.Generic;

public class CommonConfig
{
	private static string FILE_PATH = "Cfg/Common";

	private static CommonConfigInfo _commonCfgInfo;

	public static List<RankStage> rankStages = new List<RankStage>();

	public static List<PrizeItem> ratePrizeItems = new List<PrizeItem>();

	public static CommonConfigInfo CommonCfgInfo
	{
		get
		{
			return _commonCfgInfo;
		}
		set
		{
			_commonCfgInfo = value;
		}
	}

	public static void Load()
	{
		List<CommonConfigInfo> list = Utils.LoadXML<CommonConfigInfo>(FILE_PATH);
		_commonCfgInfo = list[0];
		rankStages.Clear();
		if (!string.IsNullOrEmpty(_commonCfgInfo.rankStage))
		{
			string[] array = _commonCfgInfo.rankStage.Split(':');
			RankStage item = default(RankStage);
			for (int i = 0; i < array.Length; i++)
			{
				string[] array2 = array[i].Split('_');
				item.score = Convert.ToInt32(array2[0]);
				item.star = Convert.ToInt32(array2[1]);
				rankStages.Add(item);
			}
		}
		if (!string.IsNullOrEmpty(_commonCfgInfo.rateItems))
		{
			string[] array3 = _commonCfgInfo.rateItems.Split(':');
			PrizeItem item2 = default(PrizeItem);
			for (int j = 0; j < array3.Length; j++)
			{
				string[] array4 = array3[j].Split('_');
				item2.itemId = Convert.ToInt32(array4[0]);
				item2.count = Convert.ToInt32(array4[1]);
				ratePrizeItems.Add(item2);
			}
		}
	}
}
